package fr.xelaprod.open.source.android.rss.graphicsElements;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import fr.xelaprod.open.source.android.rss.R;
import fr.xelaprod.open.source.android.rss.db.MyNewsHandleBDD;

public class DoubleChoicePopUpDeleteNews extends DoubleChoicePopUp{
	
    public DoubleChoicePopUpDeleteNews(Activity activity,String title,
    		String message,String buttonOk,String buttonCancel,
    		MyNewsHandleBDD myNews,final int id)
    {
    	super.news=myNews;
    	AlertDialog.Builder adb = new AlertDialog.Builder(activity);
    	adb.setIcon(android.R.drawable.ic_dialog_alert);
        adb.setTitle(title);
        adb.setMessage(message);
        adb.setIcon(R.drawable.world);
        adb.setPositiveButton(buttonOk, new DialogInterface.OnClickListener() {
	           public void onClick(DialogInterface dialog, int id2) {
	        	   news.open();
	        	   news.removeInfoWithID(id);
	        	   news.close();
	           }
	        });
        adb.setNegativeButton(buttonCancel, new DialogInterface.OnClickListener() {
           public void onClick(DialogInterface dialog, int id2){
           		dialog.cancel();
           }
        });
        adb.show();
   	}

}
